package com.palrevo.utils;

/**
 * 
 * @author AAsha
 * 
 */
public class StringUtils {
	
	/**
	 * 
	 * @param str
	 * @param passPhrase
	 * @return encrypted string
	 */
	public static String encryptString(String str, Integer passPhrase) {
		StringEncrypter encoder = new StringEncrypter(passPhrase.toString());
		if (str != null && str.length() > 0) {
			return encoder.encrypt(str);
		}
		return "";
	}
	
	/**
	 * 
	 * @param str
	 * @param passPhrase
	 * @return string decrypted based on information used to encrypt this string first place.
	 */
	public static String decryptString(String str, Integer passPhrase) {
		StringEncrypter encoder = new StringEncrypter(passPhrase.toString());
		if (str != null && str.length() > 0) {
			return encoder.decrypt(str);
		}
		return "";
	}
}
